package com.ruoyi.stream.framework.enums;

import com.ruoyi.stream.framework.model.configBuilder.IOTaskConfigBuilder;
import com.ruoyi.stream.framework.model.configBuilder.single.SingleIOTaskConfigBuilder;

import java.lang.reflect.Constructor;

public enum IOTaskConfigBuilderEnum {
    SINGLE_TASK(SingleIOTaskConfigBuilder.class)
    ;
    private Constructor<? extends IOTaskConfigBuilder<?>> builderConstructor;

    private Class<? extends IOTaskConfigBuilder<?>> builderClass;

    IOTaskConfigBuilderEnum( Class<? extends IOTaskConfigBuilder<?>> builderClass) {
        this.builderClass = builderClass;
        try {
            this.builderConstructor = builderClass.getConstructor();
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        }
    }

    public Constructor<? extends IOTaskConfigBuilder<?>> getBuilderConstructor() {
        return builderConstructor;
    }

    public Class<? extends IOTaskConfigBuilder<?>> getBuilderClass() {
        return builderClass;
    }
}
